{% extends 'layout.html' %}

{% block content %}
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">跟进记录表</h3>
        </div>

        <div>
            <a href="{% url 'add_consult' customer_id %}" class="btn btn-primary">新增</a>
        </div>
        <form action="" class="form-inline pull-right">
            <input type="text" name="query" class="form-control">
            <button class="btn btn-sm btn-success">搜索</button>
        </form>
        <form action="" method="post" class="form-inline">
        {% csrf_token %}
{#            <select name="active" id="" class="form-control">#}
{#                {% if request.path_info == '/crm/customer_list/' %}#}
{#                    <option value="multi_apply"> 公户转私户</option>#}
{#                {% else %}#}
{#                    <option value="multi_pub"> 私户转公户</option>#}
{#                {% endif %}#}
{#            </select>#}
{#            <button class="btn-sm bg-primary btn">应用</button>#}
            <table class="table table-bordered table-hover">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>客户</th>
                        <th>跟进内容</th>
                        <th>跟进状态</th>
                        <th>跟进人</th>
                        <th>跟进日期</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for consult in all_consult %}
                        <tr>
                            <td>{{ forloop.counter }}</td>
                            <td>{{ consult.customer }}</td>
                            <td>{{ consult.note|truncatechars:50 }}</td>
                            <td>{{ consult.get_status_display }}</td>
                            <td>{{ consult.consultant }}</td>
                            <td>{{ consult.date }}</td>
                            <td><a href="{% url 'edit_consult' consult.pk %}" class="btn bg-primary btn-sm">编辑</a></td>


                        </tr>
                    {% endfor %}

                    </tbody>
                </table>

        </form>

    </div>


{% endblock %}